<!DOCTYPE html>
<html lang="en">

<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="../res/css/weui.css" />
    <link rel="stylesheet" href="../res/css/weuix.css" />
    <!-- <link rel="stylesheet" href="../res/css/common.css" /> -->
    <script src="../res/js/tim/trtc.js"></script>
    <script src="../res/js/zepto.min.js"></script>
    <script src="../res/js/zepto.weui.js"></script>
    <script src="../res/js/common.js?v=1"></script>
    <script src="inquiry_chat.js?v=13"></script>

    <script src="../res/js/tim/purl.js"></script>
    <script src="../res/js/tim/vconsole.min.js"></script>
    <script src="../res/js/tim/GenerateTestUserSig.js"></script>
    <script src="../res/js/tim/lib-generate-test-usersig.min.js"></script>
    <!-- <script src="../res/js/tim/imBase.js"></script> -->
    <script src="../res/js/socket.js"></script>

    <style>
        iframe{
            vertical-align: middle;
        }
    </style>
</head>
<script>
    //浏览器点击返回时
    window.addEventListener('popstate', function (e) {
        //当用户点击返回按钮时，需要执行的操作
        console.log(1);
        document.body.innerHTML = ""
    }, false);
    $(function () {
        var isChatWait = getQst("isChatWait");
        var wsConnection = wsConnection

        var logId = getQst("log_id"),
            doctor_id = getQst("doctor_id"),
            doctor_imid = getQst("doctor_imid"),
            log_type = getQst("log_type"),
            inquirypatientId = getQst("inquirypatientId"),
            patientIM = getQst("patientIM"),
            tvflag = getQst("tvflag")

        function pushHistory() {
            var state = {
                title: "title",
                url: "#"
            };
            window.history.pushState(state, "title", "#");
        }
        //根据isChatWait判断是要进入哪一个页面
        if (isChatWait == 1) {
            console.log(1);
            // document.body.innerHTML =
            //     `<iframe id="aframe" name="aframe" src="inquiry_chatwait.htm?log_id=${logId}&doctor_id=${doctor_id}
            //     &doctor_imid=${doctor_imid}&log_type=${log_type}&tvflag=${tvflag}" frameborder="0"  marginheight="0" marginwidth="0" width="100%" height="100%"></iframe>`
            goPage(`inquiry_chatwait.htm?log_id=${logId}&doctor_id=${doctor_id}&doctor_imid=${doctor_imid}&log_type=${log_type}&tvflag=${tvflag}`)
        } else {
            console.log(0);
            // document.body.innerHTML =
            //     `<iframe id="aframe" name="aframe" src="inquiry_chat.htm?log_id=${logId}&doctor_id= ${doctor_id}
            //     &doctor_imid= ${doctor_imid}&log_type= ${log_type}&inquirypatientId=
            //     ${inquirypatientId} &patientIM= ${patientIM}" frameborder="0"  marginheight="0" marginwidth="0" width="100%" height="100%"></iframe>`
            goPage(`inquiry_chat.htm?log_id=${logId}&doctor_id=${doctor_id}&doctor_imid=${doctor_imid}&log_type=${log_type}&inquirypatientId=${inquirypatientId}&patientIM=${patientIM}`)
        }



    })
</script>

<body>

</body>

</html>
